<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var time = prompt("请输入时间")
        switch (time) {
            case '12':
                alert('中午好');
                break;
            case '18':
                alert('傍晚好');
                break;
            case '23':
                alert('深夜好');
                break;
        }
    </script>
</head>

<body>

</body>

</html>